package com.applepaihs.mapper;

import com.applepaihs.model.Redropesettle;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface RedropesettleMapper extends BaseMapper<Redropesettle> {

    void updateMyPriceByIds(@Param(Constants.WRAPPER) LambdaQueryWrapper wrapper, @Param("amount") int amount);

    @Update("UPDATE redropesettle SET my_price = my_price - #{money} WHERE id = #{id}")
    void deductionPrice(@Param("id") Long id, @Param("money") Integer money);
}
